﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PaymentHistory.aspx.cs" Inherits="_2011DBProject.PaymentHistory" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<link rel=StyleSheet HREF='design1.css' type='text/css'>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>새벽 골프</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <p align =left>
        <asp:Button ID="btnGoLogout" runat="server" onclick="btnGoLogout_onclick" 
            Text="☜ 로 그 아 웃" Width="150px" />
        <asp:Button ID="btnGoServer" runat="server" onclick="btnGoServer_onclick" 
            Text="☜ 서 버 선 택" Width="150px" /></p>
    
        <br />
        <br />
        <br />
    
        <asp:Label ID="lblID" runat="server" Text="아이디" Font-Size="Large" 
            ForeColor="#FFFF99" Font-Bold="True"></asp:Label>
&nbsp;
        <asp:Label ID="Label1" runat="server" Text="님의 결제내역입니다."></asp:Label>
        <br />
        <br />
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            DataSourceID="sqldsPayment" EmptyDataText="표시할 데이터 레코드가 없습니다." Height="121px" 
            Width="661px" HorizontalAlign="Center" CellPadding="7">
            <Columns>
                <asp:BoundField DataField="PAYMENT_NO" HeaderText="순번" 
                    SortExpression="PAYMENT_NO" />
                <asp:BoundField DataField="PRODUCT_NAME" HeaderText="상 품 명" 
                    SortExpression="PRODUCT_NAME" />
                <asp:BoundField DataField="PAYMENT_DATE" HeaderText="결 제 날 짜" 
                    SortExpression="PAYMENT_DATE" />
                <asp:BoundField DataField="END_DATE" HeaderText="만 료 날 짜" 
                    SortExpression="END_DATE" />
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="sqldsPayment" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            DeleteCommand="DELETE FROM &quot;PAYMENT&quot; WHERE &quot;ACCOUNT_ID&quot; = :ACCOUNT_ID AND &quot;PAYMENT_NO&quot; = :PAYMENT_NO" 
            InsertCommand="INSERT INTO &quot;PAYMENT&quot; (&quot;ACCOUNT_ID&quot;, &quot;PAYMENT_NO&quot;, &quot;PAYMENT_DATE&quot;, &quot;END_DATE&quot;, &quot;PRODUCT_NO&quot;) VALUES (:ACCOUNT_ID, :PAYMENT_NO, :PAYMENT_DATE, :END_DATE, :PRODUCT_NO)" 
            ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
            SelectCommand="SELECT P.PAYMENT_NO, M.PRODUCT_NAME, P.PAYMENT_DATE, P.END_DATE 
FROM PAYMENT P, MERCHANDISE M
WHERE P.PRODUCT_NO = M.PRODUCT_NO and P.ACCOUNT_ID = :ACCOUNT_ID
ORDER BY P.PAYMENT_NO" 
            
            
            UpdateCommand="UPDATE &quot;PAYMENT&quot; SET &quot;PAYMENT_DATE&quot; = :PAYMENT_DATE, &quot;END_DATE&quot; = :END_DATE, &quot;PRODUCT_NO&quot; = :PRODUCT_NO WHERE &quot;ACCOUNT_ID&quot; = :ACCOUNT_ID AND &quot;PAYMENT_NO&quot; = :PAYMENT_NO">
            <SelectParameters>
                <asp:SessionParameter Name="ACCOUNT_ID" SessionField="USER" />
            </SelectParameters>
            <DeleteParameters>
                <asp:Parameter Name="ACCOUNT_ID" Type="String" />
                <asp:Parameter Name="PAYMENT_NO" Type="Decimal" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="ACCOUNT_ID" Type="String" />
                <asp:Parameter Name="PAYMENT_NO" Type="Decimal" />
                <asp:Parameter Name="PAYMENT_DATE" Type="DateTime" />
                <asp:Parameter Name="END_DATE" Type="DateTime" />
                <asp:Parameter Name="PRODUCT_NO" Type="Decimal" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="PAYMENT_DATE" Type="DateTime" />
                <asp:Parameter Name="END_DATE" Type="DateTime" />
                <asp:Parameter Name="PRODUCT_NO" Type="Decimal" />
                <asp:Parameter Name="ACCOUNT_ID" Type="String" />
                <asp:Parameter Name="PAYMENT_NO" Type="Decimal" />
            </UpdateParameters>
        </asp:SqlDataSource>
        <br />
        <br />
        <br />
        <br />
        <br />
    
    </div>
    </form>
</body>
</html>
